UPSB v4
Off-topic / Batch File Coding
-
Date: Wed, Jul 31 2013 05:44:09
How to move the content of a .txt file to another .txt file without overwriting it? if example.txt contains [B]Ex1 1 Ex2 2 Ex3 3 Ex4 4 Ex5 5[/B] and Line_to_add.txt contains: [B]This is a line This is another line just for kicks![/B] I would like the output to be: [B]Ex1 1 Ex2 2 Ex3 3 Ex4 4 Ex5 5 This is a line This is another line just for kicks![/B]
-
Date: Wed, Jul 31 2013 08:07:52
Why are you asking this on a penspinning forum? I'm pretty sure there are batch forums out there.
-
Date: Wed, Jul 31 2013 08:11:40
ChainBreak wrote: Why are you asking this on a penspinning forum? I'm pretty sure there are batch forums out there.
i already tried that, is there something wrong posting in off topic? maybe someone here knows how to do that -
Date: Wed, Jul 31 2013 08:31:29
lol stackoverflow can reply this is a few seconds. Use python for such stuff, quite easy.
-
Date: Wed, Jul 31 2013 14:41:31
Or use your superiour shell (sorry, windows guys, you suck):
No programming needed. And yes, you use cat to concatenate files, not displaying their contents.cat example.txt Line_To_Add.txt > result.txt
-
Date: Thu, Aug 1 2013 05:21:33
Pixels;266243]lol stackoverflow can reply this is a few seconds. Use python for such stuff, quite easy.[/QUOTE] i dont have enough knowledge on python T_T, [QUOTE=webspider wrote: Or use your superiour shell (sorry, windows guys, you suck):
i guess i have to move to unix/linux
No programming needed. And yes, you use cat to concatenate files, not displaying their contents.cat example.txt Line_To_Add.txt > result.txt
-
Date: Fri, Aug 2 2013 06:43:29
cmd.exe is a sad joke compared to bash/zsh/whatever_other_shell.elf. And no, powershell isn't really a replacement for them (because it's mostly like having an object-oriented and very verbose shell with access to system internals). It's all about having tools like cat, head, tail, less, echo, man and so on and so forth and being able to chain them as you please. That way you avoid using actual programming a lot of times under unix-like operating systems (yes, OSX counts, too). And yes, there are ports of these tools for windows, but I never bothered using them because I have the real deal.
-
Date: Fri, Aug 2 2013 16:40:00
i think > works in windows cmd.
-
Date: Tue, Aug 6 2013 10:15:18
found it! [B]Type asd.txt >> asd.txt[/B]
-
Date: Tue, Aug 6 2013 11:28:07
webspider wrote: cmd.exe is a sad joke compared to bash/zsh/whatever_other_shell.elf. And no, powershell isn't really a replacement for them (because it's mostly like having an object-oriented and very verbose shell with access to system internals). It's all about having tools like cat, head, tail, less, echo, man and so on and so forth and being able to chain them as you please. That way you avoid using actual programming a lot of times under unix-like operating systems (yes, OSX counts, too). And yes, there are ports of these tools for windows, but I never bothered using them because I have the real deal.
Which OS/Linux Distro do you use, out of curiosity? -
Date: Sat, Aug 10 2013 05:57:35
@eurocracy: Actually I abandoned all hope for linux because I hated how bothersome it was to tweak. Some day I had my windows laptop swapped for OSX and as soon as I learned to love having a shell for all sorts of tasks, I found Arch (and abandoned OSX eventually). It's quite nice if you're after minimalism and technical simplicity and like developing.