9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a file
H,20180624200732,VPAS,TRANS_HDR,20180724,
VPAS.TRANS_HDR.20180724.01.txt, ,93,
T,1,
I have to change and instead first comma put ",1" like below
H,20180624200732,VPAS,TRANS_HDR,20180724,
VPAS.TRANS_HDR.20180724.01.txt,1,93,
T,1,
I made
sed "2s/, /,1/"... (8 Replies)
Discussion started by: digioleg54
8 Replies
2. Shell Programming and Scripting
Hi Experts,
Please support
I have below data in file in comma seperated, but 4th column is containing comma in between numbers, bcz of which when i tried to parse the file the column 6th value(5049641141) is being removed from the file and value(222.82) in column 5 becoming value of column6.
... (3 Replies)
Discussion started by: as7951
3 Replies
3. Shell Programming and Scripting
Hi All,
I have a file which has data like
a,b
c,d
e,f
g,h
And I need to insert a new column at the begining with sequence no( 1 to n)
1,a,b
2,c,d
3,e,f
4,g,h
Please let me know how to acheive this in unix (3 Replies)
Discussion started by: weknowd
3 Replies
4. Shell Programming and Scripting
I,
I have a file and i need to replace comma and blank space with comma and 0.
cat file.txt
a,5
b,1
c,
d,
e,4
I need the output as
cat file.txt
a,5
b,1
c,0
d,0 (4 Replies)
Discussion started by: jaituteja
4 Replies
5. Shell Programming and Scripting
Hi,
I have a filein unix like
ABC,CDE
BCD,KHL
and the output i need is like
column1 column2
ABC,CDE ABC
ABC,CDE CDE
BCD,KHL BCD
BCD,KHL KHL. Can some body help me out?
Hi,
The code is working fine. But in my file each row does not have always 1 comma. It may... (6 Replies)
Discussion started by: jagdishrout
6 Replies
6. Shell Programming and Scripting
I have a comma (,) delimited file.
106232145,"medicare","medicare,medicaid",789
I would like to count the number of fields in each line.
I tried the below code
awk -F ',' '{print NF-1}'
This returns me the result as 5 instead of 4. This is because the awk takes... (9 Replies)
Discussion started by: machomaddy
9 Replies
7. Shell Programming and Scripting
Hi,
I am new to unix shell shell scripting. I have a specific requirement where I need to append comma's based on the max number of column in the file.
Eg:
If my source file look something like this,
sengwa,china
tom,america,northamerica
smith,america
walter
My output file... (8 Replies)
Discussion started by: nicholas_ejn
8 Replies
8. Shell Programming and Scripting
Hi All,
silly question that I'm sure is easy to answer for a more experienced coder...
I have a file called test.txt containing the following text...
need, to, break, this, line, into, individual, lines
using sed, I'd like to make the file look like this...
need
to
break
this
line... (5 Replies)
Discussion started by: newbie_coder
5 Replies
9. Shell Programming and Scripting
Hi all,
for i in `cat /tmp/tester.txt`
do
echo $i
done
The content of /tmp/tester.txt is as below
1001,asp
1002,java
1003,vc
Now when I try the above program it gives me a output in the same way as below.
1001,asp
1002,java
1003,vc (2 Replies)
Discussion started by: mahalakshmi
2 Replies