10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I am new to Unix. I need help in writing a code and the requirements are of as below:
1) The code is in awk code
2) Append multiple spaces to a string
Example: Address = "House_NO:1100"
I have to make sure the length of Address should be always 100, if it is less than 100, i have to... (5 Replies)
Discussion started by: Venu Gopal
5 Replies
2. UNIX for Dummies Questions & Answers
Hi,
Requesting some help with a problem I am facing with string function in UNIX. I wish to create 2 string variables: 1st header string containing output_1, output_2, .. , output_<n> and 2nd data string containing the filename separated by colon (":") and corresponding filesize separated by... (6 Replies)
Discussion started by: vkumbhakarna
6 Replies
3. Shell Programming and Scripting
Hello, could you please help with this one. I have an input file like this:
123,4567,89000
123456789,9876543,12
and for the output I need strings to be with the fixed length, let's say 15, and if the string is -lt 15 to be populated with blanks at the end until it reach 15, like this:
123 ,4567... (1 Reply)
Discussion started by: apenkov
1 Replies
4. Shell Programming and Scripting
Ok. I for the life of me cant figure out how to do this. I need Help. So here is what I'm trying to do. I have a block of text. They are FIPS codes for counties. Below is the block. There are probably a few ways to do this. The first line starting with ARC021....... this line is a list of... (2 Replies)
Discussion started by: chagan02
2 Replies
5. Shell Programming and Scripting
child_amt=$amount
prev_line="$prev_line $child_amt"
i am getting the result like this
21234567890001343 000001004OLFXXX029100020091112 0000060
but i want 8 spaces between the eg:
21234567890001343 000001004OLFXXX029100020091112 0000060
how can i do this in .ksh (1 Reply)
Discussion started by: kshuser
1 Replies
6. Shell Programming and Scripting
hi all,
i have variables a and b with values, like
a="/var/tmp/new.sh /var/tmp/new2.sh"
b="/TEST"
how i need to append the value "/TEST" before the values for the variable "a" so that i get the output as
/TEST/var/tmp/new.sh /TEST/var/tmp/new2.sh
plz help me
Regards,
NG (2 Replies)
Discussion started by: Nandagopal
2 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I have a problem where I need to append few spaces(say 10 spaces) for each line in a file whose length is say(100 chars) and others leave as it is.
I tried to find the length of each line and then if the length is say 100 chars then tried to write those lines into another file and use a sed... (17 Replies)
Discussion started by: prathima
17 Replies
8. Shell Programming and Scripting
hi i have a file like (every string contains 16 chars)
CTL1330000000000
0000 00
008000
0080000000
i need to form a line and write to a file
CTL13300000000000000 00008000 0080000000
total chars should be 64
... (2 Replies)
Discussion started by: Satyak
2 Replies
9. Shell Programming and Scripting
How to append constant No of spaces suppose 52 at end of each line in a file (xyz) excluding first and last line.
Please Help me out for the same. (1 Reply)
Discussion started by: deepam
1 Replies
10. UNIX for Dummies Questions & Answers
Hi
I am looping through the contents of a file as follows
cat file |while read inrec
do
echo $inrec >> $TMP
done
(obviously this isn't all i am doing as it would be pointless but for the sake of the problem this is the important bit)
The file has fields which are separated by... (1 Reply)
Discussion started by: handak9
1 Replies