Search Results

Search: Posts Made By: 33junaid
2,181
Posted By 33junaid
thanks...its wokring fine now... The total...
thanks...its wokring fine now...

The total number of records in file is 11
2,181
Posted By 33junaid
The issue is solved but it is giving an extra...
The issue is solved but it is giving an extra line in the output even using the below statement:

count2=`get_number1 | awk '{print $1}'`

count2=
11
+ echo The total number of records in file...
2,181
Posted By 33junaid
thanks a lot...it is working now...
thanks a lot...it is working now...
2,181
Posted By 33junaid
Simple Shell Script using function
Hi all,
I am new to shell scripting.I have made a simple shell script which will give me number of records in a database table. The SQL statement is working fine and there are 11 rows in this table....
22,369
Posted By 33junaid
I just wrote this script and is working very...
I just wrote this script and is working very fine:

#!/bin/bash

counter1=0
for i in `ls -ltr | grep -v "total" | grep -v "pre_swh" | awk '{ print $9 ":" $5 }'`;
do

...
22,369
Posted By 33junaid
it is not giving the correct result....where is...
it is not giving the correct result....where is the filesize in first variable?
22,369
Posted By 33junaid
Array Declaration and For Loop
I am just stucked in syntax.This is more like a array and for loop problem.

I want to use ls -l command and get filezise and filename of all filenames in the directory in an array (say array#1)....
1,936
Posted By 33junaid
Thanks....I think the first approach is easy...
Thanks....I think the first approach is easy one.....what we can do is get filenames and sizes of each file in TEMP directory using ls -ltr command......then sleep for 2 minutes........after 2...
1,936
Posted By 33junaid
Moving Completely Transfered files
I have a driectoty called TEMP on server 1.There is a process running on another server which is pushing files in this directory of server 1.
I want to write a script which will move the files from...
10,316
Posted By 33junaid
The output I get is like this: Header...
The output I get is like this:


Header (plus) Trailer
Record1
Recrod2
...
...
Record n
(blank line here)

Everything is perfect except that why this blank line is appearing when we have...
10,316
Posted By 33junaid
ok that is fine but I was just concerned about...
ok that is fine but I was just concerned about the number of files created........there is one problem that I am getting one extra line (blank line) at the end of file...........why is so using this...
10,316
Posted By 33junaid
thanks for the reply......the code is working...
thanks for the reply......the code is working fine.....ur code is :

awk ' { if ( NR == 1 ) { head=substr($0,1,300);} else { last = substr($0,1,300);} arr[i++]=$0; }END{ printf "Header is : %-300s...
10,316
Posted By 33junaid
any luck for me as well?
any luck for me as well?
10,316
Posted By 33junaid
Thanks.....I tried the code but sed command is...
Thanks.....I tried the code but sed command is not working properly,it is giving output:

sed: command garbled: 1 c\ Header is: Headervalue.......Trailer is: Trailer value.....


It makes no...
10,316
Posted By 33junaid
Overwrite & Delete in Text File
Dear All,

I have text file like this:

Header
Record 1
Record 2
.......
Record n
Tail

This line of code :
awk '{ if ( NR == 1 ) { head=substr($0,1,300);} else { last =...
46,072
Posted By 33junaid
thanks a lot......it is working perfect......now...
thanks a lot......it is working perfect......now only one issue left of performance..............the situation was like this:

Header
Record 1
Record 2
.......
Record n
Tail

The above code...
46,072
Posted By 33junaid
Is there any way that we can fix first 300...
Is there any way that we can fix first 300 characters for header and then 300 characters for trailer no matter how long or short is the actual data.......i.e. if header/trailer length is less than...
46,072
Posted By 33junaid
Thanks a lot..........it is now working fine with...
Thanks a lot..........it is now working fine with both ways....I shall post in future more requirements and sample output.....sorry for that..........let me check with 100MB file and see the...
46,072
Posted By 33junaid
Dear, we r back to the problem.........it...
Dear,

we r back to the problem.........it gives output in 2 lines now.......

Header 1 is: Header Value
Trailer 1 is: Trailer Value


where as i want like this:

Header 1 is : Header...
46,072
Posted By 33junaid
I tried this but with this command, only trailer...
I tried this but with this command, only trailer is written on the new_file........i.e. only output of last command is there not of previous three commands.......
46,072
Posted By 33junaid
echo -n 'Header is: '; echo -n head -1...
echo -n 'Header is: '; echo -n head -1 file1.txt ; echo -n ' Trailer is: '; echo -n tail -1 file1.txt > new_file


Now the problem is that it is displaing all correct on the screen but...
46,072
Posted By 33junaid
the second command after the echo starts in new...
the second command after the echo starts in new line not on the same line.........
46,072
Posted By 33junaid
Yes that is done.Thanks....wat if I want to...
Yes that is done.Thanks....wat if I want to insert some word in between the 2 commands but on same line?

head -1 filename; "Some Text" ; tail -1 filename > newfilename

it is taking "Some text"...
46,072
Posted By 33junaid
Combine Two Commands Output
How i can combine output of two commands in one file.......i tried this but it is not working although each command is working good seperately.....


head -1 filename | tail -1 filename


i...
19,122
Posted By 33junaid
Head and Tail in One Line
I am new to UNIX......I have one file which contains thousnads of records with header and tailer.

Header
Record 1
Record 2
....
....
Last Record
Trailer

I want to concatenate Header and...
Showing results 1 to 25 of 27

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