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 am trying to use the below sed command to replace all "|" to ^, in a folder had 50 dat files. when i tried with 1 file it worked but when i tried with wild card, is not working.
sed -i 's/"|"/\^/g' *.dat
Is this the proper way to use sed command thank you very much for help. (3 Replies)
Discussion started by: cplusplus1
3 Replies
3. Shell Programming and Scripting
with in my files i have the data like this, starting with a pipe and ending the line with a pipe.
all i want is to replace the first and last pipe , remove those
trying to use following sed command, but it is only showing on the screen the entire data of the file as if it removed, but when i... (4 Replies)
Discussion started by: cplusplus1
4 Replies
4. Shell Programming and Scripting
Hi,
I need to replace an entire mailx line as follows using sed:
sed -e 's/<line1>/<newline>/g' <filename>
But I am getting comman garbled error since the new line has many special characters. I enclosed allspecial chars in \ but still no use.
Can any one help me?
Please use code... (2 Replies)
Discussion started by: vinodhin4
2 Replies
5. Shell Programming and Scripting
Hello,
I heva a problem creating a script that read specifc value from all the files of an entire folder
I have a number of email files into a directory and i need to extrect from each file 2 specific values.
After that i have to put them into a new file that looks like that:
To: value1
... (1 Reply)
Discussion started by: ahmenty
1 Replies
6. UNIX for Dummies Questions & Answers
Hi Everyone,
I am new and need your help.
Can anyone please help me in removing the ^M character from all the file in a folder recursively.
Please provide me the code.
Response will be Really appreciated.
Thanks in Advance (4 Replies)
Discussion started by: Manu_Learner
4 Replies
7. Shell Programming and Scripting
Hi All,
I have a file having one line only.
It is like
trapsess:inform|10.232.167.18|1|1|50|25|0|0|0|5|1|1|78|0037|
I want to replace the numbers in last two columns by As.
It should look like
trapsess:inform|10.232.167.18|1|1|50|25|0|0|0|5|1|1|AA|AAAA|
Please, suggest me any shell... (12 Replies)
Discussion started by: mukeshbaranwal
12 Replies
8. Shell Programming and Scripting
Hi All,
Was wondering how I can do the following....
I have a String as follows
"ACCTRL000005022RRWDKKEEDKDD...."
This string can be in a file called tail.out or in a Variable called $VAR2
Now I have another variable called $VAR1="000004785" (9 bytes long), I need the content of... (5 Replies)
Discussion started by: mohullah
5 Replies
9. Shell Programming and Scripting
cat input.txt
agsbdafgd
ertebrtreter
ahrbrwerg
The last character of a line that does not start with a would be changed to Z.
Final output:
agsbdafgd
ertebrtreteZ
ahrbrwerg
Can anyone post the sed command to do that? (2 Replies)
Discussion started by: cola
2 Replies
10. Shell Programming and Scripting
Hi guys,
I´m trying to replace the 2 last folders name in a list of directories with a new string, but I´m don´t know which regex to apply.
Directories list:
C/my user/documents/games & music
C/my user/documents/photos 09-24-2008
C/my user/settings/config ?1_2
* The last folder may have... (11 Replies)
Discussion started by: cgkmal
11 Replies