10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Folks,
I have a report data like the one seen below.
FRUITS@NEW_ORANGE(1500 04/29)
FRUITS@NEW_ORANGE(1500 05/04)
FRUITS@NEW_ORANGE(1500 05/05)
FRUITS@NEW_ORANGE(1500 05/07)
FRUITS@NEW_ORANGE(1500 05/12)
I need to use each of this lines separately in another for loop like the one... (2 Replies)
Discussion started by: jayadanabalan
2 Replies
2. UNIX for Dummies Questions & Answers
awk 'BEGIN{FS = "Ç"}
NR == 1 {p = $0; next}
NF > 1 {print p; p = $0}
NF <= 1 {p = (p " " $0)}
END {print p}' input.txt > output.txt
This is what the input data file looks like with broken lines
Code:
29863 Ç890000000 Ç543209911 ÇCHNGOHG
Ç000000001 Ç055 ... (4 Replies)
Discussion started by: cumeh1624
4 Replies
3. Shell Programming and Scripting
Hi,
I want to check if the given line from a text file has a spaces in between. if it does, then I want to add '"' double quotes at the beginning and end of the line. Otherwise leave the line as it is.
For example, below is the sample content from my file.
$cat file.txt
test1
test2... (6 Replies)
Discussion started by: svajhala
6 Replies
4. Shell Programming and Scripting
Hi Guys,
I want remove starting space of each line ...
My Input:
A B C D E
C V F G H
F R T Y U
D F G H J
L O I U Y G P O
K O P L O
L O I P
P O P
P P P P
My Output:
A B C D E
C V F G H (7 Replies)
Discussion started by: asavaliya
7 Replies
5. Shell Programming and Scripting
How can I delete spaces at the begining of all lines of my file ? (2 Replies)
Discussion started by: Sara_84
2 Replies
6. Shell Programming and Scripting
I am trying to show each word on a separate line, but read in all the words on one command line. Below is the code I have right now:
read name
MyString=$name
name2=" "
echo $MyString | awk -v ORS="" '{ gsub(/./,"&\n") ; print }' | \
while read char
do
if
then
... (8 Replies)
Discussion started by: tvb2727
8 Replies
7. Shell Programming and Scripting
for eg:
i have i/p file as:
================
i
wnt
to
change end of line
=================
my require ouput is like:
i wnt to change end of line
==================== (7 Replies)
Discussion started by: RahulJoshi
7 Replies
8. Shell Programming and Scripting
Hi all,
Is there a way to perform the above, I am trying to strip out more than one space from a line, but keep the single space. See below output example.
My Name is test test2 test3 test4 test5
My Name is test test2 test3 test4 test5
Please note that the lines would contain... (7 Replies)
Discussion started by: eo29
7 Replies
9. Shell Programming and Scripting
HI,
cat test
abc
echo "def" >> test
output is
cat test
abc
def
the needed output is
cat test
abc def
and so on (5 Replies)
Discussion started by: jobycxa
5 Replies
10. Shell Programming and Scripting
i have a file named as templist which looks like this:
i want to translate spaces to a new line so that the file would look like this
im using sed with this sed -e 's/" "/\n/' templist > templist.out but it doesn't work. can someone please help me. (2 Replies)
Discussion started by: dakid
2 Replies