How would I delete white spaces in a specified file?
Also, I'd like to know what command I would use to take something off a regular expression, and put it onto another.
ie.
.
.
.
expression1 <take_off>
.
.
.
expression2 (put here)
.
.
.
Any help would be great, thanks! (10 Replies)
hi all...
i have the next question:
i have a flat file with a lot of records (lines). Each record has 10 fields, which are separated by pipe (|). My problem is what sometimes, in the first record, there are white spaces (no values, nothing) in the beginning of the record, like this:
ws ws... (2 Replies)
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)
Hi,
Can anybody suggest me how to combine two strings with two or more white spaces and assign it to a variable?
E.g.
first=HAI
second=HELLO
third="$first $second" # appending strings with more than one white spaces
echo $third
this would print
HAI HELLO
Output appears... (2 Replies)
Hi,
How can I remove the unwanted spaces in the line.
123456 789 ABC DEF. - I wanna remove the sapces in this line, I need the output 123456789ABCDEF.
Pls help me...... (3 Replies)
Dear Members,
Following is the code which i am using:
integer i=7
while ((i <= 10 ));
do
param=`echo $TEST_OUT | cut -d"^" -f$i`
a=`echo ${param}`
echo `echo $a | sed 's/+/ /g'`
(( i = i + 1));
done
From the above code TEST_OUT is a variable which has the following value:
... (1 Reply)
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)
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)
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)
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)