Mark End Of File


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Mark End Of File
# 1  
Old 11-10-2008
Mark End Of File

Hello,

I've realized, thanks to Jim, that in C - deleting a single record in a file is not possible.
Is there a way of moving the EOF of the file (and by that, discarding the last records of the file)?



Thank you....
# 2  
Old 11-10-2008
You cannot do that in C, quite the way you asked... close. Look into the truncate() call.
It chops off from a given position to the end of a file.
# 3  
Old 11-11-2008
Thank you very much.
Again you have helped me a lot!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grep a log file starting from a specific time to the end of file

I have a log file which have a date and time at the start of every line. I need to search the log file starting from a specific time to the end of file. For example: Starting point: July 29 2018 21:00:00 End point : end of file My concern is what if the pattern of `July 29 2018 21:00:00`... (3 Replies)
Discussion started by: erin00
3 Replies

2. Shell Programming and Scripting

How to extract start/end times from log file to CSV file?

Hi, I have a log file (log.txt) that which contains lines of date/time. I need to create a script to extract a CSV file (out.csv) that gets all the sequential times (with only 1 minute difference) together by stating the start time and end time of this period. Sample log file (log.txt) ... (7 Replies)
Discussion started by: Mr.Zizo
7 Replies

3. UNIX for Dummies Questions & Answers

Add strings from one file at the end of specific lines in text file

Hello All, this is my first post so I don't know if I am doing this right. I would like to append entries from a series of strings (contained in a text file) consecutively at the end of specifically labeled lines in another file. As an example: - the file that contains the values to be... (3 Replies)
Discussion started by: gus74
3 Replies

4. UNIX for Advanced & Expert Users

quotation mark use

Hi colleagues, I am development a script. this flat file pp.txt contain this tree lines. prueba prueba1 prueba2 cat pp.txt |awk '{print a}' |while read a do var=`db2 select count(*) from $a`" echo $var done executing var show me error. I need var contain: db2... (1 Reply)
Discussion started by: systemoper
1 Replies

5. Shell Programming and Scripting

Backwards question mark appearing in FTP'd file

Hi all, I'm trying to FTP what looks like a simple .txt file from my Windows XP desktop to my UNIX server. I've tried using several programs to do this including UltraEdit and FTP Commander. I have tried sending it ascii, binary and even let the program decide. But every time it arrives in UNIX... (4 Replies)
Discussion started by: Korn0474
4 Replies

6. UNIX for Dummies Questions & Answers

tag/mark a file with current absolute path

Hi all, I need to mark a file with it's current location in the file system before being moved. This will enable the file to be restored back to it's original location. Can anyone provide any ideas about the best way to do this, at present i'm trying to use readlink -m to strip off the... (1 Reply)
Discussion started by: skinnygav
1 Replies

7. AIX

mkinstallp mark a file as volatile

I want to make a bff installp package which should be AIX5.2 compatible, but i don't know how to mark a file as volatile within the mkinstallp's template file. Anyone could help pls? (1 Reply)
Discussion started by: acerlinux
1 Replies

8. Shell Programming and Scripting

Add end of char \n on end of file

Hi, I want to add \n as a EOF at the end of file if it does't exist in a single command. How to do this? when I use command echo "1\n" > a.txt and od -c a.txt 0000000 1 \n \n 0000003 How does it differentiate \n and eof in this case? Regards, Venkat (1 Reply)
Discussion started by: svenkatareddy
1 Replies

9. Shell Programming and Scripting

~mark

hi guys I am studing unix and I have some questions to ask. what is the diffrence beteween man and info? how and when we use ~ mark? tanks henk ;) (1 Reply)
Discussion started by: henk
1 Replies

10. Shell Programming and Scripting

Append a field to the end of each line of a file based on searching another file.

Hi All, I have two comma separated value(CSV) files, say FileA and FileB. The contents looks like that shown below. FileA EmpNo,Name,Age,Sex, 1000,ABC,23,M, 1001,DES,24,F, ... (2 Replies)
Discussion started by: ultimate
2 Replies
Login or Register to Ask a Question