Tag Info

New answers tagged

0

This is a task that is well suited for almost any of the scripting languages that exist, most of which are available even for Windows. The task can be accomplished in any of: Bash scripting - www.cygwin.com - for windows Perl - Active state Perl Python - www.python.org, windows version exists, I recommend 2.7.x for beginners) REXX - e.g. Regina REXX On ...


1

Kindly refer to the solution here I am posting that solution again @echo off set f1=1.txt set f2=2.txt set "sep= " % tab % ( for /f "delims=" %%a in (%f2%) do ( setlocal enabledelayedexpansion set /p line= echo(!line!!sep!%%a endlocal ) )<%f1%


0

Unfortunately, you used the drive syntax, A:, B:, R: The correct way to do this is to save it as: A\NewFileTxt.txt B\NewFileTxt.txt R\NewFileTxt.txt


1

Similar to DavidPostill's answer, but you can use a wildcard to remove everything before a substring. @echo off setlocal enabledelayedexpansion for /f "tokens=*" %%a in (%1) do ( set line=%%a echo !line:*swimsphinx: =! ) endlocal Pass the name of the text file into the script when you call it (or replace %1 with your text file name).


0

Not a cmd solution and loving Powershell but this is actually one of vim's fortes. %s/.*:_ and you're done. _ being the space character


0

Here comes my personal choice using PythonPy. Works across multiple OS and you can reuse your Python knowledge. Even if you don't know Python learning it would be easier than spending time with Awk & Sed stuffs. Here's how you need to start. Install PythonPy for windows pip install pythonwpy Use this command type test | wpy -x 'print(x.split(" ...


6

(EDIT: Just for clarity, as noted by David, this isn't going to work in the generic windows cmd interpreter. This is more of a powershell one-liner) You could do something like this: cat chat.log | %{$_ -replace "\[[^]]*\] +[^ ]*: ",""} > words.txt Translated: read the contents of chat.log, then pipe that into a command to replace anything that looks ...


1

If the lines are always in the same format you can use the following batch file. test.cmd: echo off Setlocal EnableDelayedExpansion for /f "tokens=4 delims=:" %%a in (log.txt) do ( set _txt=%%a echo !_txt:~1! >> filtered.txt ) input: C:\test>type log.txt [Jun 01 2015 02:23:58 UTC] swimsphinx: test1 abc [Jun 01 2015 02:24:15 UTC] ...


0

Quick and dirty. Not usable on huge server infrastructures due to the high performance need on huge files. But for reasonable file sizes viable: while read file2_var ; do if [ "$file2_var" != "$(grep $file2_var path/to/file1)" ]; then echo $file2_var >> file3.txt; fi ; done < path/to/file2 I am just fooling around with scripts for a month and this I did ...


0

Did you actually log in to your mailbox using IE on Windows7 recently? If you enabled 2-step verification for you email, this normally happens every time you log in from a new environment. If not, someone else is trying to hack your email, change your password immediately! this link might be relevant to your case About 2-Step Verification



Top 50 recent answers are included