Help with changing text file layout


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with changing text file layout
# 8  
Old 11-27-2012
And here you see the beauty of awk Smilie
Code:
 awk '$1=$1' RS= infile

Note the space after RS= (same as RS="")

Last edited by Jotne; 11-27-2012 at 04:41 AM..
This User Gave Thanks to Jotne For This Post:
# 9  
Old 11-28-2012
it is beautiful, thank you!

Quote:
Originally Posted by Jotne
And here you see the beauty of awk Smilie
Code:
 awk '$1=$1' RS= infile

Note the space after RS= (same as RS="")
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Add delimiter to a file from layout file

I need to add delimiter in file abc.txt using layout.txt for eg 1 to 2 is category field so after that I need to add delimiter ~ abc.txt 110101160315100000000000000 110101160315100000000000000 Layout.txt CATEGORY POSITION (1:2) char, 2 GROUP_ID ... (8 Replies)
Discussion started by: lalitpct
8 Replies

2. UNIX for Dummies Questions & Answers

Changing only the first space to a tab in a space delimited text file

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

3. UNIX for Dummies Questions & Answers

Changing text in multiple files, but with different text for each file

Hello, I have a situation where I want to change a line of text in multiple files, but the problem is that I want to change the text to something unique for each file. For example, let's say I have five files named bob.txt, joe.txt, john.txt, tom.txt, and zach.txt. Each of these files has a... (5 Replies)
Discussion started by: Scatterbrain26
5 Replies

4. UNIX for Dummies Questions & Answers

Changing table layout

Hi everyone, I'm a beginner in Unix, and would need some help from you guys! My input (pipe delimited): City|ZIP|Ref. Item NYC|212|00004 NYC|212|00032 NYC|212|00006 LA|90049|00068 LA|90049|00009 SF|94131|0027 You can see that the first 3 lines have column 1 and 2 in common, same for... (8 Replies)
Discussion started by: beca123456
8 Replies

5. Shell Programming and Scripting

Changing a text file

I have a file as below and want to change it using awk I want to find the entries such as Iteration No.788 Best Value 0.00408152 Next-Worst Value 0.00522935 Worst Value 0.00523487 and change it to Iteration No.788 788. Best Value = 0.00408152 788. ... (8 Replies)
Discussion started by: kristinu
8 Replies

6. Shell Programming and Scripting

CHANGING THE TEXT INSIDE A FILE

Hi All, I need a small help in formating a file. I have a file with word like this; ATGHYJIKOLFHJDHDGDYFGFYGRYGFYRHFYHFUED DHDJFDFSJFLFJSKJFSLKJFGHDKLGLDKGLKDNVNV VNLDVLDVDHFJDKDJVNVHSUFNHJFMVJFMVKJMFV ... .... ....like this 75000 words. I want to convert this words into a single... (5 Replies)
Discussion started by: Lucky Ali
5 Replies

7. Shell Programming and Scripting

Changing the text file format

Hi, I have a shell script to unload all the empname who have salary >50000 from the emp table into a text file(empname.txt) . m_db unload "$dbc_file" -column_delimiter ',' -select "SELECT empname FROM emp where salary > 50000" >> empname.txt Now my text file have data in the following format ... (3 Replies)
Discussion started by: kavithakuttyk
3 Replies

8. Linux

Changing default keyboard layout in Linux

Hi I have Fedora linux with XFCE desktop. I want to use Indic lanquage in that. I have installed unicode devnagri fonts. But I am not able to change my default keyboard layout. How can I change default keyboard layout in XFCE or through command line. Thanks NeeleshG (0 Replies)
Discussion started by: neel.gurjar
0 Replies

9. UNIX for Dummies Questions & Answers

Changing Keyboard layout

Hi, How do i go about changing the keyboard layout to the UK layout. currently the @ symbol on the keyboard appears as a " sybol on the monitor. Many Thanks in advance Kam (1 Reply)
Discussion started by: vishnura
1 Replies

10. Shell Programming and Scripting

Changing the column for a row in a text file and adding another row

Hi, I want to write a shell script which increments a particular column in a row from a text file and then adds another row below the current row with the incremented value . For Eg . if the input file has a row : abc xyz lmn 89 lm nk o p I would like the script to create something like... (9 Replies)
Discussion started by: aYankeeFan
9 Replies
Login or Register to Ask a Question