How to read entire output from a file?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to read entire output from a file?
# 1  
Old 02-10-2011
How to read entire output from a file?

Hello-

I am trying to view a file which is quite large. However, whenever I do 'cat (file name)' it shows me just the half.. I am using Putty to access my server.

Also, is it possible to edit a file from a unix system on a 'Gedit for Windows" text editor?

Thanks
This User Gave Thanks to DallasT For This Post:
# 2  
Old 02-10-2011
Well, files over 2 or 4GB can mess up 32 bit commands, but usually the ksh does a 64 bit open(), so:
Code:
cat <file_name

Usually, I use an ssh file mover like scp, or an ssh file moving gui. Doesn't putty have a file mover?

Files from UNIX are easy to edit in wordpad but not notepad, as the lines are lf delimited, not cr-lf delimited (Mac likes cr delimited, so WinDOS is in the middle). You can add the cr to make them windows friendly. I use sed beause I do it so rarely that I forget the names of the cr adding and stripping programs, dos2unix or something such.
This User Gave Thanks to DGPickett For This Post:
# 3  
Old 02-10-2011
Hmm "quite large" is not a number.

Please show basic detail about the file and the server, blotting anything confidential with X's:
Code:
uname -a
echo "${SHELL}"
ls -lad filename
file filename

What command did you type?
# 4  
Old 02-11-2011
You can get a lot, often almost a meg., into env variables; VM not /tmp, no cleanup issues:
Code:
 
export xxx=$(<file)

# 5  
Old 02-22-2011
Quote:
Originally Posted by DallasT
Also, is it possible to edit a file from a unix system on a 'Gedit for Windows" text editor?
Why use a Gnome "parrot" when there's Emerald Editor. It was once known as Crimson Editor, and is written and equipped with all the same basic and extended features of its predecessor. I actually prefer it to everything in Linux save the Emacs Client GUI. It does fall short in a few areas (f'r'instance the installed vocab file for its Spell Check is six lines long and requires manual editing for any more words), but given everything else it can do -- including reading "quite large" files created in Linux {7- or 8-bit text as well as non-text} -- that's a ladle in a lake, if you get my meaning.

Thought I'd add a helpful suggestion. Hoping it wasn't too OT for this thread; I don't mean to distract while the OP still hasn't got a workable answer to his question.

BZT
# 6  
Old 02-23-2011
There is "more" to view what datamodel the file is based on and "grep" for when you are looking for specific items in the file. From there on, you can start to build your load script, or whatever processing you wish to do with the file. In other words, you can start to view the file without using editors.
# 7  
Old 02-23-2011
You can also use "less" instead of "more". less allows you to scroll up and down.

In regards to editing a file vi or vim works great via command line.
I don't know if gedit is available on Unix by default, but that would fo couse require gnome.

In regards to putty's file mover, you can download pscp from putty's website. Just google search for pscp.exe. If you are using windows, I like to rename pscp.exe to scp.exe and place it in the windows directory.
I guess for those who are unfamiliar with vi or vim, can use nano (old pico replacement). This may be a real good time to use vi or vim as it is quite powerful.
This User Gave Thanks to truecall For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

User with read-only to entire filesystem

Is this even possible? Its a request for external auditors to login remotely. (5 Replies)
Discussion started by: psychocandy
5 Replies

2. Shell Programming and Scripting

Bash script read specific value from files of an entire folder

Hello, I heva a problem creating a script that read specifc value from all the files of an entire folder I have a number of email files into a directory and i need to extrect from each file 2 specific values. After that i have to put them into a new file that looks like that: To: value1 ... (1 Reply)
Discussion started by: ahmenty
1 Replies

3. Shell Programming and Scripting

How to read each line from input file, assign variables, and echo to output file?

I've got a file that looks like this (spaces before first entries intentional): 12345650-000005000GL140227 ANNUAL HELC FEE EN 22345650-000005000GL140227 ANNUAL HELC FEE EN 32345650-000005000GL140227 ANNUAL HELC FEE EN I want to read through the file line by line,... (6 Replies)
Discussion started by: Scottie1954
6 Replies

4. Shell Programming and Scripting

Redirecting output for the entire script

Hi All, I am trying to redirect output for every line in a korn shell script that is going to generate output and append it to a log file. I have been doing this after EACH and every line that is going to produce output: command 1 >> test.log command 2 >> test.log command 3 >>... (5 Replies)
Discussion started by: MIA651
5 Replies

5. Shell Programming and Scripting

Read file and for each line replace two variables, add strings and save output in another file

Hi All, I have a file, let's call it "info.tmp" that contains data like this .. ABC123456 PCX333445 BCD789833 I need to read "info.tmp" and for each line add strings in a way that the final output is put /logs/ua/dummy.trigger 'AAA00001.FTP.XXX.BLA03A01.xxxxxx(+1)' where XXX... (5 Replies)
Discussion started by: Andy_ARG
5 Replies

6. Shell Programming and Scripting

How to Read the entire file using while loop

Guys, I am trying to read the whole file using while loop but when i run the ssh part of the script it reads only the first line and exit after that. There are in total 134 lines in the file, but when the output is redirected, it does only for one line and comes to command prompt. pls help..... (11 Replies)
Discussion started by: sdosanjh
11 Replies

7. UNIX for Dummies Questions & Answers

Read from a file then filter the output

Hi i need a script which reads a certain file and then display it on the screen. The thing is i need to filter the display output. this is an example of the file which is to be loaded in the script. asdfg1.1.1|98 hjkldfe4.0.3|123 asdzxzvdweradfsdafascv10.0.10|123456789... (1 Reply)
Discussion started by: khestoi
1 Replies

8. UNIX for Advanced & Expert Users

Read the entire output fired by ps command

Actually I want to display the entire output fired by ps command. My output gets trucated after 80 chars. Thus, i am not able to see the entire command running when i give a ps -eaf .... Does anyone know how do i display the entire output fired by ps command .. (i.e the command along with... (5 Replies)
Discussion started by: vinithepoo
5 Replies

9. Shell Programming and Scripting

read file and output message

hi, I have a baby.txt file with two type of message: xxxxxxxx is missing xxxxxxxxxxx is not missing xxxx is missing xxxxxxxx is not missing xxxxxxxx is not missing For the above, I need to read file and get all "xxxx is missing" and write into baby_missing.txt. If no message "xxxxx is... (12 Replies)
Discussion started by: happyv
12 Replies

10. Shell Programming and Scripting

store output to a file and read from it

Hello all, I need to run snoop command for a period of time (a day) and extract remote host column from it to find out who is accessing my server. When I run the following on the command line it works snoop -port 22 | awk '{print $3}' but when I do snoop -port 22 | awk '{print $3}' | while... (2 Replies)
Discussion started by: afadaghi
2 Replies
Login or Register to Ask a Question