10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a file which comes every day and the file data look's as below.
Vi abc.txt
a|b|c|d\n
a|g|h|j\n
Some times we receive the file with only a new line character in the file like
vi abc.txt
\n (8 Replies)
Discussion started by: rak Kundra
8 Replies
2. Shell Programming and Scripting
i have a datafile (data.txt) that has the following data:
#Beginner`echo... (4 Replies)
Discussion started by: SkySmart
4 Replies
3. Shell Programming and Scripting
Hi all..
I have a text file which looks like below:
abcd
efgh
ijkl
(blank space)
I need to remove only the last (blank space) from the file. When I try wc -l the file name,the number of lines coming is 3 only, however blank space is there in the file.
I have tried options like... (14 Replies)
Discussion started by: Sathya83aa
14 Replies
4. Shell Programming and Scripting
I have a file (pema)with a single long record which i have to break up into multiple lines
Input
s1aaaaaaaaaaaaaaaaaaaaaaas1bbbbbbbbbbs1cccccccccc
Output
s1aaaaaaaaaaaaaaaaaaaaaaa
s1bbbbbbbbbb
s1cccccccccc
m planning to do it by replacing s1 by \ns1 \n is the new line character
i... (5 Replies)
Discussion started by: pema.yozer
5 Replies
5. Shell Programming and Scripting
Removed.
My question does not make sense. and SED does see the last newline character.
But I still have a question:
How to remove the last newline character(the newline character at the end of last line) using SED?
---------- Post updated 05-01-11 at 10:51 AM ---------- Previous update was... (7 Replies)
Discussion started by: kevintse
7 Replies
6. Shell Programming and Scripting
I'd like to remove (do a pattern or precise replacement - this I can handle in SED using Regex )
---AFTER THE 1ST Occurrence ( i.e. on the 2nd occurrence - from the 2nd to fourth occurance ) of a specific string : type 1
-- After the 1st occurrence of 1 string1 till the 1st occurrence of... (4 Replies)
Discussion started by: sieger007
4 Replies
7. Shell Programming and Scripting
typeset -i i=1
while read -r filename; do
Splitfile=`$Targetfile_$i.txt`
awk 'substr($0,1,5) == substr($filename,1,5) && substr($0,526,2) == substr($filename,6,2) && substr($0,750,12) == substr($filename,8,12)' $SourceFilename >> $Splitfile
i=i+1
done < /tmp/list.out
I am using this logic... (1 Reply)
Discussion started by: pukars4u
1 Replies
8. UNIX for Dummies Questions & Answers
hi,
I want to print the below lines
"Message from bac logistics
The Confirmation File has not been received."
When i give like this in the code
"Message from bac logistics\n The Confirmation File has not been received."
It is giving only
Message from bac logistics\n The... (9 Replies)
Discussion started by: trichyselva
9 Replies
9. Shell Programming and Scripting
Is there any way to remove carriage retuns between the records?
These carriage returns are created in an excel cell by using Alt+enter, this is similar to new line...
We have input records separated by TABS and have carriage returns as below:
123 456 789 ABC "1952.00" 678 "abcdef
ghik... (5 Replies)
Discussion started by: acheepi
5 Replies
10. UNIX for Dummies Questions & Answers
Hi,
I am trying to write a script to prepare some text for use as web content.
What is happening is that all the newlines in the textfile are ignored, so I want
to be able to replace/add a few characters so that for a file containg:
This is line 1.
This is line two.
This is line four.... (1 Reply)
Discussion started by: ghoti
1 Replies