Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi guys,
currently i have a list of over 6000 contact of info in this form below
Name : tom
address : 49 cedar point
state : ohio
COuntry : USA
Name : jerry
address : 32 cedar point
state : ohio
COuntry : USA
Name : henry
address : 23 washinton
state : LA
COuntry : USA
How do i transpose it into this format in the fastest way?Name Address state Country
Tom 49 cedar.. Ohio USA
Jerry 32 cedar.. Ohio USA
Henry 23 washin.. LA USA
I am able to do it for a few rows. However is there any faster way for me to repeat this process as i have over 1000 contacts?Many thanks.

yuanhe,
Try this. Assumption is that all new entries start with the tag "Name :" (note the space after 'Name' before the ':'.
adrs.txt is the input file and outAdrs.txt is the output file.setlocal enabledelayedexpansion for /f "delims=: tokens=1,2*" %%I in (adrs.txt) do ( if "%%I"=="Name " echo. >> outAdrs.txt set /p t=%%J <nul >> outAdrs.txt )--
Holla.

@echo off & setLocal EnableDelayedExpansion
> newfile echo Name Address state Country
for /f "tokens=1* delims=: " %%a in (myfile) do (
set /a N+=1
set v!N!=%%b
if !N! equ 4 (
>> newfile echo !v1! !v2! !v3! !v4!
set N=0
)
)
=====================================
If at first you don't succeed, you're about average.M2

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |