10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I am using following script to name the file base of some values
#!/bin/sh
sourcefile=$1
awk '
BEGIN{ n = 1; name = "FILEFILE12" n ".txt"; }
{
if (substr($0,1,10) == "FILEFILE12")
{
close (name)
n++
a = substr($0,11,10);
b = substr($0,21,5);
name = b "_Src_" a ".txt"
}... (6 Replies)
Discussion started by: manish8484
6 Replies
2. Shell Programming and Scripting
Hi guys,
when I take substring of a particular data using this command
var=substr($0,11,10)
it comes with spaces, when I am trying to trim the spaces it is not allowing me to do that.
Can you please help me out on that.
As I have to reverse the output of the variable also.
---------- Post... (0 Replies)
Discussion started by: manish8484
0 Replies
3. Shell Programming and Scripting
I have a file which contains certain records about users. the row length is always fixed to 205 characters.
Now I want to read each record line from the file, substring some portion out of it and put into another file. But I have observed that my script is trimming the extra spaces I have used for... (4 Replies)
Discussion started by: Pramit
4 Replies
4. Shell Programming and Scripting
My file looks like this:
But I would like to 'trim' all sequences to the same lenght 32 characters, keeping intact all the identifier (>GHXCZCC01AJ8CJ)
Would it be possible to use awk to perform this task? (2 Replies)
Discussion started by: Xterra
2 Replies
5. Shell Programming and Scripting
I'm trying to parse an output log and I've managed to reduce the output to the lines I need. But I'm having trouble pulling out only the info I'm interested in. The output is 40+ lines and here is a sample
Installing AppFresh 0.8.5.pkg from ./InstallerFiles/CustomPKG/26 (26)
Installing... (2 Replies)
Discussion started by: kaltekar
2 Replies
6. Shell Programming and Scripting
friends,
I have a script in solaris 10 SPARC system which is like this
date '+Time: %m/%d/%y %H:%M:%S'
echo " GDBRR GDLRR GDBWR GDLWR GDRRR GDRWR "
sar -b 10 10 |/usr/xpg4/bin/awk '!/Average/ && !/SunOS/ && !/bread/ {$1="";T=$2;T1=$3;T2=$5;T3=$6;T4=$8;T5=$9}{print(T"\t",... (1 Reply)
Discussion started by: achak01
1 Replies
7. Shell Programming and Scripting
hi have output as
i have trim of lines before CREATE statement and lins after last ")"
any idea how to achieve it ? (3 Replies)
Discussion started by: crackthehit007
3 Replies
8. UNIX for Advanced & Expert Users
Hi,
I want to trim +with leading zero's with amount fields.I know using awk for trimming leading zeros with +,but I want get the entire row itself.
cat file_name |awk -F " " '{printf "%14.4f%f\n",$4}'
ex:
10 xyz bc +00000234.4500
20 yzx foxic +002456.000
Expexted
10 xyz bc... (3 Replies)
Discussion started by: mohan705
3 Replies
9. Shell Programming and Scripting
I have a variable that calls in a string from txt file. Problem is the string comes with an abundance of white spaces trailing it. Is there any easy way to trim the tailing white spaces off at the end? Thanks in advance. (9 Replies)
Discussion started by: briskbaby
9 Replies
10. Solaris
Hi my lovely friends,
Im writing one pgm in which i trying to assign some values like
$var='Jun 6'
but if i do echo of this $var will trim the spaces expect one space.
$echo $var
$Jun 6
But if var='Jun 28', then this will works fine
$echo $var
$Jun 28
this is required to exctract... (2 Replies)
Discussion started by: Lokesha
2 Replies