10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Input file:
xyz,pqrs.lmno,NA,NA,NA,NA,NA,NA,NA
abcd,pqrs.xyz,NA,NA,NA,NA,NA,NA,NA
Expected Output:
xyz pqrs.lmno NA NA NA NA NA NA NA
abcd pqrs.xyz NA NA NA NA NA NA NA
Command Tried so far:
awk -F"," 'BEGIN{OFS=" ";} {print}' $File_Path/File_Name.csv
Issue:... (5 Replies)
Discussion started by: TechGyaann
5 Replies
2. Shell Programming and Scripting
Hello,
I have some tab delimited files that may contain blank columns. I would like to delete the blank columns if they exist. There is no clear pattern for when a blank occurs.
I was thinking of using sed to replace instances of double tab with blank,
sed 's/\t\t//g'
All of the examples... (2 Replies)
Discussion started by: LMHmedchem
2 Replies
3. Shell Programming and Scripting
Hello,
I have a text file with space and tab (mixed) delimited file and need to convert into CSV.
# cat test.txt
/dev/rmt/tsmmt32 HP Ultrium 6-SCSI J3LZ 50:03:08:c0:02:72:c0:b5 F00272C0B5 0/0/6/1/1.145.17.255.0.0.0 /dev/rmt/c102t0d0BEST
/dev/rmt/tsmmt37 ... (6 Replies)
Discussion started by: prvnrk
6 Replies
4. Shell Programming and Scripting
Hi How to make tab delimited file to space delimited?
in put file:
ABC kgy
jkh ghj
ash kjl
o/p file:
ABC kgy
jkh ghj
ash kjl
Use code tags, thanks. (1 Reply)
Discussion started by: jagdishrout
1 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I have a space delimited text file but I only want to change the first space to a tab and keep the rest of the spaces intact. How do I go about doing that? Thanks! (3 Replies)
Discussion started by: evelibertine
3 Replies
6. Shell Programming and Scripting
Hi,
In source data few of columns are having special charates(like *) due to this i am not able to display the data into flat file.it's displaying the some of junk data into the flat file.
source dataExample:
Address1="XDERFTG * HYJUYTG"
how to remove the special charates in a string (2 Replies)
Discussion started by: koti_rama
2 Replies
7. Shell Programming and Scripting
I have a folder that contains say 50 files in a sequential order:
cdf_1.txt
cdf_2.txt
cdf_3.txt
cdf_3.txt
.
.
.
cdf_50.txt.
I need to merge these files in the same order into a single tab delimited file.
I used the following shell script:
for x in {1..50};
do cat cdf_${x}.txt >>... (3 Replies)
Discussion started by: Lucky Ali
3 Replies
8. UNIX for Dummies Questions & Answers
Hello,
I have about 100 files in a directory with fields which are tab delimited. I would like to append the file name as the first field and it has to be done as many times as the total lines in the file.
For example,
myFile1.txt has the following data:
1 x y z
2 a b ... (5 Replies)
Discussion started by: Gussifinknottle
5 Replies
9. Shell Programming and Scripting
Hello,
Can someone help me to do this with awk or sed? I have a file with multiple lines, each line has many fields separated with a tab. I would like to add one more field holding 'na' in between the first and second fields.
old file looks like,
1, field1 field2 field3 ...
2, field1... (7 Replies)
Discussion started by: ssshen
7 Replies
10. UNIX for Dummies Questions & Answers
Hi all,
I have a file with single white space delimited values, I want to convert them to a tab delimited file.
I tried sed, tr ... but nothing is working.
Thanks,
Rajeevan D (16 Replies)
Discussion started by: jeevs81
16 Replies