Talk:Remove lines from a file: Difference between revisions
Content added Content deleted
m (→Argument order) |
|||
Line 8: | Line 8: | ||
==Argument order== |
==Argument order== |
||
How about specifically ''not'' setting the order of arguments? This would allow the creation of a program that by default did one thing, but could be given options to remove specified options from a file. |
How about specifically ''not'' setting the order of arguments? This would allow the creation of a program that by default did one thing, but could be given options to remove specified options from a file. |
||
::I limited this task specifically to removing lines from the file, rather than a combination tool. |
|||
Woops, I've thought of something that is close to this. What do you think about creating a command line utility "extract" that by default extracted the first line from a file and printed it to stdout whilst leaving the file behind with its first line missing. extract could be given two options: a starting line (defaults to 1), and the number of (this and subsequent), lines to extract (defaults to 1). Missing lines return the null string (without a line terminator). If the file ends without a line terminator then the if that line is returned then it is without a line terminator. Numeric options should not be zero or negative. --[[User:Paddy3118|Paddy3118]] 06:55, 13 July 2011 (UTC) |
Woops, I've thought of something that is close to this. What do you think about creating a command line utility "extract" that by default extracted the first line from a file and printed it to stdout whilst leaving the file behind with its first line missing. extract could be given two options: a starting line (defaults to 1), and the number of (this and subsequent), lines to extract (defaults to 1). Missing lines return the null string (without a line terminator). If the file ends without a line terminator then the if that line is returned then it is without a line terminator. Numeric options should not be zero or negative. --[[User:Paddy3118|Paddy3118]] 06:55, 13 July 2011 (UTC) |
||
::Yeah that sounds a useful gadget. I'm not sure about the name "extract", because it actually does a deletion too, but it is a good idea, and would make a great separate task on here. [[User:Markhobley|Markhobley]] 07:08, 13 July 2011 (UTC) |