Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,30 +0,0 @@
|
|||
with Ada.Text_IO; use Ada.Text_IO;
|
||||
|
||||
procedure Read_And_Write_File_Line_By_Line is
|
||||
Input, Output : File_Type;
|
||||
begin
|
||||
Open (File => Input,
|
||||
Mode => In_File,
|
||||
Name => "input.txt");
|
||||
Create (File => Output,
|
||||
Mode => Out_File,
|
||||
Name => "output.txt");
|
||||
loop
|
||||
declare
|
||||
Line : String := Get_Line (Input);
|
||||
begin
|
||||
-- You can process the contents of Line here.
|
||||
Put_Line (Output, Line);
|
||||
end;
|
||||
end loop;
|
||||
Close (Input);
|
||||
Close (Output);
|
||||
exception
|
||||
when End_Error =>
|
||||
if Is_Open(Input) then
|
||||
Close (Input);
|
||||
end if;
|
||||
if Is_Open(Output) then
|
||||
Close (Output);
|
||||
end if;
|
||||
end Read_And_Write_File_Line_By_Line;
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
with Ada.Command_Line, Ada.Text_IO; use Ada.Command_Line, Ada.Text_IO;
|
||||
|
||||
procedure Read_And_Write_File_Line_By_Line is
|
||||
Read_From : constant String := "input.txt";
|
||||
Write_To : constant String := "output.txt";
|
||||
|
||||
Input, Output : File_Type;
|
||||
begin
|
||||
begin
|
||||
Open (File => Input,
|
||||
Mode => In_File,
|
||||
Name => Read_From);
|
||||
exception
|
||||
when others =>
|
||||
Put_Line (Standard_Error,
|
||||
"Can not open the file '" & Read_From & "'. Does it exist?");
|
||||
Set_Exit_Status (Failure);
|
||||
return;
|
||||
end;
|
||||
|
||||
begin
|
||||
Create (File => Output,
|
||||
Mode => Out_File,
|
||||
Name => Write_To);
|
||||
exception
|
||||
when others =>
|
||||
Put_Line (Standard_Error,
|
||||
"Can not create a file named '" & Write_To & "'.");
|
||||
Set_Exit_Status (Failure);
|
||||
return;
|
||||
end;
|
||||
|
||||
loop
|
||||
declare
|
||||
Line : String := Get_Line (Input);
|
||||
begin
|
||||
-- You can process the contents of Line here.
|
||||
Put_Line (Output, Line);
|
||||
end;
|
||||
end loop;
|
||||
Close (Input);
|
||||
Close (Output);
|
||||
exception
|
||||
when End_Error =>
|
||||
if Is_Open(Input) then
|
||||
Close (Input);
|
||||
end if;
|
||||
if Is_Open(Output) then
|
||||
Close (Output);
|
||||
end if;
|
||||
end Read_And_Write_File_Line_By_Line;
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
with Ada.Sequential_IO;
|
||||
|
||||
procedure Read_And_Write_File_Character_By_Character is
|
||||
package Char_IO is new Ada.Sequential_IO (Character);
|
||||
use Char_IO;
|
||||
|
||||
Input, Output : File_Type;
|
||||
Buffer : Character;
|
||||
begin
|
||||
Open (File => Input, Mode => In_File, Name => "input.txt");
|
||||
Create (File => Output, Mode => Out_File, Name => "output.txt");
|
||||
loop
|
||||
Read (File => Input, Item => Buffer);
|
||||
Write (File => Output, Item => Buffer);
|
||||
end loop;
|
||||
Close (Input);
|
||||
Close (Output);
|
||||
exception
|
||||
when End_Error =>
|
||||
if Is_Open(Input) then
|
||||
Close (Input);
|
||||
end if;
|
||||
if Is_Open(Output) then
|
||||
Close (Output);
|
||||
end if;
|
||||
end Read_And_Write_File_Character_By_Character;
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
with Ada.Text_IO; use Ada.Text_IO;
|
||||
with Ada.Text_IO.Text_Streams; use Ada.Text_IO.Text_Streams;
|
||||
|
||||
procedure Using_Text_Streams is
|
||||
Input, Output : File_Type;
|
||||
Buffer : Character;
|
||||
begin
|
||||
Open (File => Input, Mode => In_File, Name => "input.txt");
|
||||
Create (File => Output, Mode => Out_File, Name => "output.txt");
|
||||
loop
|
||||
Buffer := Character'Input (Stream (Input));
|
||||
Character'Write (Stream (Output), Buffer);
|
||||
end loop;
|
||||
Close (Input);
|
||||
Close (Output);
|
||||
exception
|
||||
when End_Error =>
|
||||
if Is_Open(Input) then
|
||||
Close (Input);
|
||||
end if;
|
||||
if Is_Open(Output) then
|
||||
Close (Output);
|
||||
end if;
|
||||
end Using_Text_Streams;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
source: read "input.txt"
|
||||
write "output.txt" source
|
||||
source >> "output.txt"
|
||||
|
||||
print source
|
||||
|
|
|
|||
|
|
@ -1 +1,5 @@
|
|||
copy input.txt output.txt
|
||||
@echo off
|
||||
setlocal enableextensions
|
||||
set /p a=<input.txt
|
||||
:: no trailing newline
|
||||
<nul >output.txt set/p=%a%
|
||||
|
|
|
|||
|
|
@ -1 +1,13 @@
|
|||
type input.txt > output.txt
|
||||
@echo off
|
||||
setlocal enableextensions
|
||||
::read first 4 lines
|
||||
<input.txt (
|
||||
set /p a1=
|
||||
set /p a2=
|
||||
set /p a3=
|
||||
set /p a4=
|
||||
)
|
||||
echo(%a1%>output.txt
|
||||
echo(%a2%>>output.txt
|
||||
echo(%a3%>>output.txt
|
||||
<nul >>output.txt set/p=%a4%
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
for /f "" %L in ('more^<input.txt') do echo %L>>output.txt
|
||||
<nul set/p=!buffer!
|
||||
|
|
|
|||
|
|
@ -1,40 +0,0 @@
|
|||
identification division.
|
||||
program-id. copyfile.
|
||||
environment division.
|
||||
input-output section.
|
||||
file-control.
|
||||
select input-file assign to "input.txt"
|
||||
organization sequential
|
||||
.
|
||||
select output-file assign to "output.txt"
|
||||
organization sequential
|
||||
.
|
||||
data division.
|
||||
file section.
|
||||
fd input-file.
|
||||
1 input-record pic x(80).
|
||||
fd output-file.
|
||||
1 output-record pic x(80).
|
||||
working-storage section.
|
||||
1 end-of-file-flag pic 9 value 0.
|
||||
88 eof value 1.
|
||||
1 text-line pic x(80).
|
||||
procedure division.
|
||||
begin.
|
||||
open input input-file
|
||||
output output-file
|
||||
perform read-input
|
||||
perform until eof
|
||||
write output-record from text-line
|
||||
perform read-input
|
||||
end-perform
|
||||
close input-file output-file
|
||||
stop run
|
||||
.
|
||||
read-input.
|
||||
read input-file into text-line
|
||||
at end
|
||||
set eof to true
|
||||
end-read
|
||||
.
|
||||
end program copyfile.
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
IDENTIFICATION DIVISION.
|
||||
PROGRAM-ID. file-io.
|
||||
|
||||
ENVIRONMENT DIVISION.
|
||||
INPUT-OUTPUT SECTION.
|
||||
FILE-CONTROL.
|
||||
SELECT in-file ASSIGN "input.txt"
|
||||
ORGANIZATION LINE SEQUENTIAL.
|
||||
|
||||
SELECT OPTIONAL out-file ASSIGN "output.txt"
|
||||
ORGANIZATION LINE SEQUENTIAL.
|
||||
|
||||
DATA DIVISION.
|
||||
FILE SECTION.
|
||||
FD in-file.
|
||||
01 in-line PIC X(256).
|
||||
|
||||
FD out-file.
|
||||
01 out-line PIC X(256).
|
||||
|
||||
PROCEDURE DIVISION.
|
||||
DECLARATIVES.
|
||||
in-file-error SECTION.
|
||||
USE AFTER ERROR ON in-file.
|
||||
DISPLAY "An error occurred while using input.txt."
|
||||
GOBACK
|
||||
.
|
||||
out-file-error SECTION.
|
||||
USE AFTER ERROR ON out-file.
|
||||
DISPLAY "An error occurred while using output.txt."
|
||||
GOBACK
|
||||
.
|
||||
END DECLARATIVES.
|
||||
|
||||
mainline.
|
||||
OPEN INPUT in-file
|
||||
OPEN OUTPUT out-file
|
||||
|
||||
PERFORM FOREVER
|
||||
READ in-file
|
||||
AT END
|
||||
EXIT PERFORM
|
||||
END-READ
|
||||
WRITE out-line FROM in-line
|
||||
END-PERFORM
|
||||
|
||||
CLOSE in-file, out-file
|
||||
.
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
*> Originally from ACUCOBOL-GT
|
||||
CALL "C$COPY" USING "input.txt", "output.txt", 0
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
*> Originally from Micro Focus COBOL
|
||||
CALL "CBL_COPY_FILE" USING "input.txt", "output.txt"
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import system'io;
|
||||
|
||||
public program()
|
||||
public Program()
|
||||
{
|
||||
var text := File.assign("input.txt").readContent();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
(defvar input (with-temp-buffer
|
||||
(insert-file-contents "input.txt")
|
||||
(buffer-string)))
|
||||
|
||||
(with-temp-file "output.txt"
|
||||
(insert input))
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
include std/io.e
|
||||
write_lines("output.txt", read_lines("input.txt"))
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
integer in,out
|
||||
object line
|
||||
|
||||
in = open("input.txt","r")
|
||||
out = open("output.txt","w")
|
||||
|
||||
while 1 do
|
||||
line = gets(in)
|
||||
if atom(line) then -- EOF reached
|
||||
exit
|
||||
end if
|
||||
puts(out,line)
|
||||
end while
|
||||
|
||||
close(out)
|
||||
close(in)
|
||||
|
|
@ -1 +0,0 @@
|
|||
Get-Content $PWD\input.txt | Out-File $PWD\output.txt
|
||||
|
|
@ -1 +0,0 @@
|
|||
Get-Content $PWD\input.txt | Set-Content $PWD\output.txt
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
write %output.txt read %input.txt
|
||||
|
||||
; No line translations:
|
||||
write/binary %output.txt read/binary %input.txt
|
||||
|
||||
; Save a web page:
|
||||
write/binary %output.html read http://rosettacode.org
|
||||
|
|
@ -1 +0,0 @@
|
|||
CreateObject("Scripting.FileSystemObject").OpenTextFile("output.txt",2,-2).Write CreateObject("Scripting.FileSystemObject").OpenTextFile("input.txt", 1, -2).ReadAll
|
||||
Loading…
Add table
Add a link
Reference in a new issue