10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line... An example of entries in the file would be:
SRVXPAPI001 ERRO JUN24 07:28:34 1775
REASON= 0000, PROCID= #E506 #1065: TPCIPPR, INDEX= 003F
... (8 Replies)
Discussion started by: Ferocci
8 Replies
2. Shell Programming and Scripting
Hi All,
I have a file.txt which seems like having three lines.
wc -l file.txt
3 file.txt
In fact, once it is open in text editor, this file has four lines where the last line is empty. how can i delete this last empty line of the file.txt? I tried the codes below so far but they... (6 Replies)
Discussion started by: senayasma
6 Replies
3. Shell Programming and Scripting
Hi,
I am new to Sed /awk commands. using that i want to add new empty line after every line in a file by leaving first three lines. So, can any one help me out how to achieve this.
Example:
---------
Input Filename: file1.txt
Input Data:
--------Report--------
Date:20-10-03... (4 Replies)
Discussion started by: G.K.K
4 Replies
4. Shell Programming and Scripting
I can't seem to get sed to allow me to insert text in the first line of an empty file. I have a file.txt that is a 0 byte file. I want sed to insert " fooBar" onto the first line. I've tried a few options and nothing seems to work. They work just fine if there's text in the file tho. Help? (4 Replies)
Discussion started by: DC Slick
4 Replies
5. Shell Programming and Scripting
How to delete all leading empty lines in a file?
$>cat input.txt
test
Test
$>
output file should be
test
Test
$> (14 Replies)
Discussion started by: johnveslin
14 Replies
6. Shell Programming and Scripting
Hi
Trying to do like this :
echo "$variable1\n $(cat file.txt)"
but it only adds one time. When I run this cmd again with different variable it only replaces line of variable1.
How to add constantly line into first line in file ? (3 Replies)
Discussion started by: presul
3 Replies
7. UNIX for Dummies Questions & Answers
I have to remove character " in file which occurs at every line and have to delete empty spaces. Please help (2 Replies)
Discussion started by: vikram2008
2 Replies
8. Shell Programming and Scripting
Hi all,
I have one CSV file(MasterFile.csv) consists of two columns.
"./incoming/ABC.CSV","./incoming/ABC_CONTROL.txt"
"./incoming/PQR.CSV","./incoming/PQR_CONTROL.txt"
"./incoming/123.CSV","./incoming/123_CONTROL.txt"
I have written a script to read the MasterFile.csv.Here i want to... (4 Replies)
Discussion started by: sollins
4 Replies
9. Shell Programming and Scripting
Hi,
I have an dir which has 50K file, some of them are empty. I want to delete the empty file from the dir. I am planning to use the following command.
ls -l | grep " 0 " | awk '{print $9}'
I can copy this to an file and then how do I use this file to delete the empty files.... Any help... (2 Replies)
Discussion started by: Script40
2 Replies
10. Shell Programming and Scripting
I know this must be really easy, but i can't get it to work
I've got a perl script, with a file.
I want to print an empty line, and the following doesn't seem to work:
print nameoffile "\n"
thanks for your help!! (3 Replies)
Discussion started by: kfad
3 Replies