Search Results

Search: Posts Made By: McLan
19,232
Posted By McLan
This code, some how not working for me. File...
This code, some how not working for me. File names are no changed. they remain same.
I have rename on my Linux and used /bin/bash as defualt shell
19,232
Posted By McLan
rename file by removing some part of the file name
I am special requirements to rename file.

I have files with names like below:

1_firstname1_lastname1.html
2_firstname2_lastname2.html
3_fistname3_lastname2.html

I would like these file to...
2,833
Posted By McLan
how to seach junk or special char in vi edit
Hi,
I have text file which is genrated by some external system(not sure of what is the edirot used)
I copied to my Solaris machine and did vi

found some strange text like below in one line.

...
32,010
Posted By McLan
Thanks awk -F',' ' { print NF }' worked for me
Thanks
awk -F',' ' { print NF }' worked for me
32,010
Posted By McLan
no of columns in csv file
Hi,

I would like to know how can I find the number of columns in each line in a csv file.

I have a csv file wiht comma separated an dhas 10000 line in it.

I want to verify the number of...
16,817
Posted By McLan
I afraid, if this is going to generate any...
I afraid, if this is going to generate any duplicate random numbers in range from 1 to 100? If yes then how can you avoid that?
If this generates the duplicate numbers then the same record will be...
16,817
Posted By McLan
Random lines selection form a file.
>cat data.dat
0001 Robbert
0002 Nick
0003 Mark
.......
1000 Jarek
3,817
Posted By McLan
Find/replace to new file: ksh -> perl
I have korn shell script that genretaets 100 file based on template replacing the number.
The template file is as below:
$ cat template
file number: NUMBER
The shell script is as below:
$ cat...
10,797
Posted By McLan
yes, I do get the number from input data file
yes, I do get the number from input data file
10,797
Posted By McLan
sed "s/s.no/$sno/" template >>out
sed "s/s.no/$sno/" template >>out
10,797
Posted By McLan
sed replace with fixed length
$ cat template
s.noName


$ sed "s/s.no/1/" template > out
$ sed "s/s.no/100/" template >>out


$ cat out
1Name
100Name


1 Name
100Name
2,983
Posted By McLan
awk how to print if the search pattern contains speace
the data file is as below:

> cat master.cnf
/usr| location for usr|5
/src/ver1| version 1 |10
/src/ver2/log| ver 2 log |25
/src/sys/apps/log| Application log for sys|36
/src/sys/apps/conf|...
15,282
Posted By McLan
outFile=printHeader.tmp ...
outFile=printHeader.tmp
dbFields='REPORT.TIMESTAMP.s,REPORT.CUSTOMER.s,REPORT.CODE.s'
echo $dbFields > $outFile
18,056
Posted By McLan
now i want to try to search with different field....
now i want to try to search with different field.

the data file is as below:
> cat master.cnf
/usr| location for usr|5
/src/ver1| version 1 |10
/src/ver2/log| ver 2 log |25
/src/sys/apps/log|...
2,750
Posted By McLan
Read line from file randomly
I have data file with customer.dat, and this contains the customer names
>cat customer.dat
FirstName1 LastName1
FistName2 LastName1
FistName3 MiddleName3 LastName3
This file can contain areoun...
Forum: Solaris 04-06-2008
64,245
Posted By McLan
date +%s, doesn't work, I tried with %S (not %s),...
date +%s, doesn't work, I tried with %S (not %s), date +%S , this gives the seconds but not epoch

Do we have any other options with perl or nawk.
Btw, I am on Solarid
Forum: Solaris 04-06-2008
64,245
Posted By McLan
perl -e 'print time(), "\n" ' prints only epoch...
perl -e 'print time(), "\n" ' prints only epoch of system time
How to get epoch of some other time than current system time?
for example I want to know the epoch of Jan 1 2000, 00hrs 00 min 00...
18,056
Posted By McLan
awk issue with slash, multiple FS
Now the requirement is different with different input file(master.cnf)
>cat master.cnf
/usr| location for usr|5
/src/ver1| version 1 |10
/src/ver2/log| ver 2 log |25
/src/sys/apps/log|...
18,056
Posted By McLan
Thanks it works for me, What does -F/ -v...
Thanks it works for me,
What does -F/ -v var=$mylog '$0 ~ var{print $1} do?

Regards,
Naresh
18,056
Posted By McLan
awk slash
I have configuration file(master.cnf), that contents are:
VER1LOG /src/ver1/log
VER2LOG /src/ver2/log
APPLOG /src/sys/apps/log
APPCONF /src/sys/apps/conf
APPBIN /src/sys/apps/bin

my shell...
4,531
Posted By McLan
Hi Aaron, This is fine, so we are displaying 4...
Hi Aaron,
This is fine, so we are displaying 4 and 5 th fields of Address.
I am not sure if the street contains only 2 fields , it can contain more fields like “your and my straat & others...
4,531
Posted By McLan
awk- report generation from input file
Thanks Klashxx
its Wonderful, it works.
I was trying to undersand what does FS="( )|(,)" do?
Could you please give more info on this, however without the above also the output is same
awk...
4,531
Posted By McLan
awk- report generation from input file
I have input file with below content:

Person:
Name: Firstname1 lastname1
Address: 111, Straat
City : Hilversum

Person:
Name : Fistname2 lastname2
Address: 222, street
Cit: Bussum
...
Showing results 1 to 23 of 23

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