Search Results

Search: Posts Made By: djsal
17,367
Posted By djsal
on the second file, run this: #!/bin/bash ...
on the second file, run this:

#!/bin/bash
cat secondfile.txt | while read line
do
FN=`echo $line | awk -F\/ '{print $(NF-1)}' `
echo $FN
done
103,770
Posted By djsal
The \ is irrelevant! It may be there to indicate...
The \ is irrelevant! It may be there to indicate that it is part of the same statement (if on two lines).

- The awk '{print $NF}' means print the last field in a space delemmited file.

- Sort...
1,868
Posted By djsal
Trying to modify a print filter!
Ok, the filter looks like this.

awk ' BEGIN{printf ("^[E^[&l2a0o7.27C^[(s0p16.67h0T");} \
{ \
printf ("%s^M\n", $0); \
} \
END{printf ("^L^[E");}'




This is sending escape sequences to...
1,558
Posted By djsal
I need help with an array!
I have the following file:

Johnny|"New York, NY"|Driver,LNU
Bob|"Los Angeles, CA"|Crew,ASA
JIM|"Rochester, NY"|Cook,GHG
Phil|"New York, NY"|Teacher,"LNU,ASA,CCC,JJJ"



What I need to...
10,997
Posted By djsal
Cat'ing a multiple line file to one line
I am writing a script that is running a loop on one file to obtain records from another file.

Using egrep, I am finding matching records in file b, then outputing feilds of both into another file....
2,176
Posted By djsal
Thank you sumeet!!!!!
Thank you sumeet!!!!!
2,176
Posted By djsal
Adding field of flatfile by an index.
Hey guys, I was given a task that involved parcing a large file that looked somthing like this...

A1-0999999,SMITH,.25
A1-0999999,JOHN,.75
A1-0999999,HELMET,.1.25
A1-0999999,HOOP,.10.25...
14,037
Posted By djsal
Making multi line output appear on one line
Basically I wanna take grep output,

EACH_OPTION_CHARGE: V033*, VMVM, 4.00, M
EACH_OPTION_CHARGE: V040*, VMVM, 4.00, M
EACH_OPTION_CHARGE: V042*, VMVM, 4.50, M
EACH_OPTION_CHARGE: ...
50,416
Posted By djsal
thanks fro the replies fellas, but I wound up...
thanks fro the replies fellas, but I wound up using sed...



cat input.fla | sed 's/\;/\
/g' | egrep -v "^\$" | sort | uniq
50,416
Posted By djsal
Replace certain character with a new a new line.
Hello all... please help with the following.

I am parsing the following type of file...

W001;
W003;
W025;W044;
W030;
W022;W024;W099;W098;

Would like to make it look like this...
W001...
Forum: Debian 07-09-2004
4,801
Posted By djsal
BTW, this is a debian machine, and a epson lq2180...
BTW, this is a debian machine, and a epson lq2180 that is attached to the server via a serial hub (referred to as a Digiboard by some)... the port settings are as follows:

# stty -a <...
Forum: Debian 07-09-2004
4,801
Posted By djsal
Serial printer cutting last page of long reports...
Any ideas what could cause this? I have flow control set to XON XOFF on the printer and the on the OS level.
Forum: Linux 06-16-2004
90,996
Posted By djsal
Users are in /etc/passwd.... cat /etc/passwd...
Users are in /etc/passwd....

cat /etc/passwd | awk -F: '{print $1" ---> "$4}'

will return all users and which group they are in.
Forum: Debian 06-16-2004
5,085
Posted By djsal
Setting Routes and such
Ok, I made changes to my routing tables..... which file do I modify to make the routes initialize correctly when the machine boots up? I work with all flavours of Unix/Linux... but this is an older...
32,927
Posted By djsal
Ok I got ya now! I figured I would test it out...
Ok I got ya now! I figured I would test it out by running it with input from a cat, didnt know awk would choke on the empty lines. much thanx, this is definately going in my little book of notes!
32,927
Posted By djsal
Much thanx for everyones responses...Ygor and...
Much thanx for everyones responses...Ygor and Rameshonline.... I have tried what you have stated here and I get the following message:

cat file.rpt | awk '{print $(NF-1)}'
awk: cmd. line:1:...
32,927
Posted By djsal
printing 3rd or 4th feild from last in awk.
Whats up fellas... hope someone can help me with the following...

I am parsing an file that is space delimited, however, in the middle, there is an ugly "Account Name" feild that in itself has...
8,255
Posted By djsal
sorry man, thats the only way I know how...
sorry man, thats the only way I know how...
8,255
Posted By djsal
This will do the trick! #Korn shell or Bash ...
This will do the trick!

#Korn shell or Bash

for list in `ls -1t *.c*`
do
prefix=`echo $list | awk -F"\." '{print $1}'`
mv $list ${prefix}.cpp
done
3,421
Posted By djsal
Parsing a textfile, sorting and doing math fucntions.
whats up all, I am very happy I joined this forum, I have learned alot just going through.

I have a small dilemma... trying to parse a textfile, and sort by 1st feild and add up second feild....
...
25,152
Posted By djsal
Just another way to do it.... ...
Just another way to do it....
-------------------------------------
for list in `ls -1t $path`
do
if grep $search_arg > /dev/null
then
echo "${path}/${list}" >> yourfile.txt
fi
done...
17,786
Posted By djsal
getting the average of a list of decimals.
Whats up fellas, I am new here... just wanted to see if anyone knew a way to get an avergage of a list of numbers... I am trying to use bc (number of records in file divided by sum of all records in...
100,835
Posted By djsal
Re: Getting yesterday DATE
I needed that functionality once too, I went about it by appending the current date to a file every day at 23:59 in cron... then refrencing that file whenever I needed to write a script to get things...
Showing results 1 to 23 of 23

 
All times are GMT -4. The time now is 06:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy