10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
We have a csv file as mentioned below and the requirement is to change the date format in file as mentioned below.
Current file (file.csv)
----------------------
empname,date_of_join,dept,date_of_resignation
ram,08/09/2015,sales,21/06/2016
"akash,sahu",08/10/2015,IT,21/07/2016
... (6 Replies)
Discussion started by: gopal.biswal
6 Replies
2. UNIX for Dummies Questions & Answers
Hi
I have a asterisk (*) delimited file and there are some fields which contain data having asterisk , now i want to double quote the fileds which contain data with asterisk
Ex:
input file
ID*NAME*EMAIL
1*BILL*BILL@AOL.com
2*J*OY*JOY@msn.com
in the 2nd record JOY has a asterisk value in... (11 Replies)
Discussion started by: halmstad
11 Replies
3. Shell Programming and Scripting
Dear All,
1.txt (tab in between each value in a line)
a b c
a b c
a c d
you can see below, why with ~ i can output with tab, but = cannot?
# awk -F'\t' '$2 ~ /b/' 1
a b c
a b c
# awk -F'\t' '$2 = "b"' 1
a b c
a b c
a b d
... (1 Reply)
Discussion started by: jimmy_y
1 Replies
4. UNIX for Dummies Questions & Answers
Hi ,
I have extract a single field from the 2nd row of a file of which the format is as given below
"Field1","Field2","Field3",...,"Field17",...
I need to cut Field17 as such (no quotes required)..
I give the command
head -2 file_name | tail -1 | cut -d "," -f17
But the output is... (2 Replies)
Discussion started by: nivin_govindan
2 Replies
5. Shell Programming and Scripting
hi
here my problem:
i have 2 file:
1.tmp
111
222
555
2.tmp
1*TEST1**111*LA
2*TEST2**112*LA
3*TEST3**222*LA
4*TEST4**333*LA
5*TEST5**555*LA (5 Replies)
Discussion started by: saw7
5 Replies
6. Shell Programming and Scripting
Hi Everyone,
a.txt
a b c 1 e e e e e
a b c 2 e e e e e
the output is
a b c 1 e e e e e
a 00b c 2 e e e e e
when 4th field = '2', then add '00' in the front of 2nd field value.
Thanks (9 Replies)
Discussion started by: jimmy_y
9 Replies
7. Shell Programming and Scripting
The typical line of the input file is as follows,
123|abcde|"xyz|mn"|ghelosa|3455hello|
The delimiter is |. I need to change it to another delimiter, say ~. For the above line, the output should be:
123~abcde~xyz|mn~ghelosa~3455hello~
The challenge is when | appears in a field, it... (2 Replies)
Discussion started by: derekxu
2 Replies
8. Shell Programming and Scripting
I have a file with millions of rows that I need to add a delimiter and a new field with a zero to the end of each row. (its too big to open and do a find and replace regex)
I'm looking for the next line '\n' and need to replace it with a Unit Separator (hex \037) 0 \n.
I've tried the... (2 Replies)
Discussion started by: kmac
2 Replies
9. Shell Programming and Scripting
I have file with 20 fields and its pipe delimiter. I need to remove the 18th field along with pipe delimiter that seperates 17th and 18th field. In turn that means i want to make it now a file with only 19 fields. Can some body let me know how ican remove the 18th field from the whole file? (5 Replies)
Discussion started by: dsravan
5 Replies
10. Shell Programming and Scripting
Hi
I have a file that looks like the following:
Name1 aaa bbbb
Name1 ffd hhghg
Name1 dffg ghhhh
Name2 rtrt dfff
Name2 rrtfr tgtt
Name2 dsddf gfggf
Name2 ffffg gfgf
NAme3 fdff ghhgh
Is it possible to format it so that a number... (2 Replies)
Discussion started by: azekry
2 Replies