---
title: "FSO: Loopa ut alla rader!"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/157420-fso-loopa-ut-alla-rader"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "oskars"
published: "2007-02-21T13:43:54.000Z"
updated: "2007-02-21T13:47:39.000Z"
replies: 3
views: 315
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/asp/157420-fso-loopa-ut-alla-rader"
---

# FSO: Loopa ut alla rader!

## #1 — oskars, 2007-02-21T13:43Z

Hej,

jag har denna koden:

```
<div style="font-size:12px;">
<%
	set fs = Server.Createobject("scripting.FileSystemObject")
	set rfile = fs.OpenTextFile(server.mappath("testfilen.txt"))
	
	filecontent = Replace(rfile.ReadAll," ","_")
	
		'Efternamn
		col1 = Right(filecontent,211)
		col1 = Left(col1,36)
		'Namn
		col1 = Replace(col1,",","#")
		
		'Adress
		col2 = Right(filecontent,175)
		col2 = Left(col2,36)
		
		'Postnummer
		col3 = Right(filecontent,139)
		col3 = Left(col3,6)
		
		'Ort
		col4 = Right(filecontent,133)
		col4 = Left(col4,38)
		
		'Fordon
		col5 = Right(filecontent,84)
		col5 = Left(col5,24)
		
		'Årsmodell
		col6 = Right(filecontent,60)
		col6 = Left(col6,2)
		
		'Datum1
		col7 = Right(filecontent,36)
		col7 = Left(col7,6)
		
		'Datum2
		col8 = Right(filecontent,30)
		col8 = Left(col8,6)
		
		Line = col1 & "#" & col2 & "#" & col3 & "#" & col4 & "#" & col5 & "#" & col6 & "#" & col7 & "#" & col8 & "#"
		
		Response.Write Line & "<br />"
	
	rfile.close
	set rfile = nothing
	set fs = nothing
%>
</div>
```

Hur bygger jag om den så den går igenom varje rad och loopar ut dom på sidan?

Tacksam för hjälp!

Mvh
Oskar

Permalänk: https://www.webforum.nu/p/157420

## #2 — @nders, 2007-02-21T13:45Z

typ:

```
while not rfile.atendofstream
    foo = rfile.readline
    ' gör saker och ting med [i]foo[/i]
wend
```

Permalänk: https://www.webforum.nu/p/1936351

## #3 — yohpops, 2007-02-21T13:46Z

Bifoga exempel på textfilen.

Permalänk: https://www.webforum.nu/p/1936353

## #4 — oskars, 2007-02-21T13:47Z

> **@nders skrev:**
>
> typ:
>
> ```
> while not rfile.atendofstream
>     foo = rfile.readline
>     ' gör saker och ting med [i]foo[/i]
> wend
> ```

Grymt! Tack!! :)

Permalänk: https://www.webforum.nu/p/1936354

---

Tråden på webben: https://www.webforum.nu/amne/asp/157420-fso-loopa-ut-alla-rader
