php – Unknown characters between each letter when reading the CSV uploaded to Laravel

I'm trying to upload a CSV file, read its contents, and import that data into a database, but apparently I get an error where an unknown character appears between each character.

This is my code:

    $file = $request->file('file');
    $fileName = $file->getRealPath();
    $file = fopen($fileName, "r");

    $i = 0;
    while (($column = fgetcsv($file, 10000, ";")) !== FALSE) {

        if ($i == 0){
            $i++;
            continue;
        }
        echo print_r($column);$i++;    
    }

    fclose($file);

I get that from print_r:

Enter image description here

Any ideas why it could be? I tried to open the CSV encoding UTF8 and UTF16, but I still have this problem.

Thank you in advance.

Command Line – How do I find the separator used in a TXT file and convert it to a comma separated CSV?

I have a TXT file that has either tab or space delimiter. I have to convert it to csv. How do you suggest doing this from the command line?

$ perl -F"//" -nlae 'for (@F) {$a{$_}++};for (keys %a){print $_ if ($a{$_}+1==5 && !($_=~/w/))};undef %a' moth_gt.txt

The above command gives nothing.

The file looks like this:

$ head -10 moth_gt.txt 
1.0000  494.5551  234.2510  711.6219  274.2668  481.7198  299.5598  311.0864  339.5756
2.0000  494.6552  233.6892  698.5310  237.2043  478.3979  300.0367  285.5068  300.0367
3.0000  496.0657  234.5680  660.4773  182.6485  477.8938  299.0346  279.7346  239.3273
4.0000  498.0948  236.4126  618.2942  142.6347  477.2553  302.2803  298.6309  175.0104
5.0000  499.2109  237.2335  603.7807  120.0112  473.9058  307.5669  323.1914  136.0130
6.0000  497.2581  236.8611  616.7132  115.5453  473.4415  309.7994  336.1240  123.7323
7.0000  497.2588  237.2343  642.7633  126.7104  471.5815  313.1497  329.7984  132.6645
8.0000  499.1200  239.4676  669.9296  159.0866  470.0935  315.7552  312.3086  156.4817
9.0000  498.0675  237.7640  703.4297  201.8367  468.7934  317.1588  292.7054  184.0948
10.0000  498.9722  237.7636  718.0843  248.8523  469.6981  316.7149  282.5214  219.1346

The following command also did not help:

$ cat moth_gt.csv | tr "\t" "," >  moth_comma.csv

CSV files can not be exported from the personal or public view of Sharepoint

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
(System.Reflection.Assembly) :: LoadWithPartialName (& # 39; Microsoft.SharePoint.Client & # 39;) | Out-Null

(System.Reflection.Assembly) :: LoadWithPartialName (& # 39; Microsoft.SharePoint.Client.Runtime & # 39;) | Out-Null
(System.Reflection.Assembly) :: LoadWithPartialName (& # 39; Microsoft.SharePoint.Client.Publishing & # 39;) | Out-Null

$ login = & # 39; DomainName-Here Email-Here.org & # 39;
$ password = ConvertTo-SecureString & # 39; password-here & # 39; -AsPlainText -Force
$ webUrl = & # 39; https: // URL / sites / Tam / List & # 39;
$ listName = & # 39; / ListName / ViewName & # 39;

$ context = New Object Microsoft.SharePoint.Client.ClientContext $ webUrl
Microsoft.SharePoint.Client.SharePointOnlineCredentials $ login, $ password
$ context.Credentials = Name of new object type System.Management.Automation.PSCredential -argumentlist & # 39; $ login & # 39 ;, $ password

$ web = $ context.Web
$ list = $ web.Lists.GetByTitle ($ listName)
Write Host "CompletelURL" $ webUrl $ listName

$ query = New object Microsoft.SharePoint.Client.CamlQuery
$ items = $ list.GetItems ($ query)

$ context.Load ($ items)
$ context.ExecuteQuery ()

$ ListItemCollection = @ ()

$ items | for each {

$ ExportItem = New-Object PSObject

$ ExportItem | Add member -MemberType NoteProperty name "ID" value $("I WOULD")
$ ExportItem | Add member -MemberType NoteProperty name "ClientFullName" value $
( "Client Full Name")
$ ExportItem | Add member -MemberType NoteProperty name "ClientID" value $("Customer ID")
$ ExportItem | Add member -MemberType NoteProperty name "AssignedTo" value $
("Assigned to")
$ ExportItem | Add member -MemberType NoteProperty name "ITTSentDate" value $( "ITTSentDate")
$ ExportItem | Add member -MemberType NoteProperty name "HearReqDueDate" value $
( "HearReqDueDate")
$ ExportItem | Add member -MemberType NoteProperty name "ITTTermReason" value $( "ITTTermReason")
$ ExportItem | Add-Member -MemberType NoteProperty-Name "Source" value $
("Source")
$ ExportItem | Add member -MemberType NoteProperty name "AmendIssueDate" value $( "Amendment Issue Date")
$ ExportItem | Add member -MemberType NoteProperty name AmendReasons value $
( "Amendment Reasons")
$ ExportItem | Add member -MemberType NoteProperty name "RescindIssueDate" value $( "RescindIssueDate")
$ ExportItem | Add member -MemberType NoteProperty name "RescindReason" value $
( "RescindReason")
$ ExportItem | Add member -MemberType NoteProperty name "HearReqRecdDte" value $( "HearReqRecdDte")
$ ExportItem | Add member -MemberType NoteProperty name "HearApprDenied" value $
( "HearApprDenied")
$ ExportItem | Add member -MemberType NoteProperty name "HearDateApprDenied" value $( "HearDateApprDenied")
$ ExportItem | Add member -MemberType NoteProperty name "DeniedReason" value $
( "DeniedReason")
$ ExportItem | Add member -MemberType NoteProperty name "DateSentLegal" value $( "DateSentLegal")
$ ExportItem | Add member -MemberType NoteProperty name "HearSchedNoticeDate" value $
( "HearSchedNoticeDate")
$ ExportItem | Add-Member -MemberType NoteProperty name "HearDate" value $( "Hear Date")
$ ExportItem | Add member -MemberType NoteProperty name "HearReschedDate1" value $
( "HearReschedDate1")
$ ExportItem | Add member -MemberType NoteProperty name "HearReschedDate2" value $ _ ("HearReschedDate2")

$ ListItemCollection + = $ ExportItem

}

$ ListItemCollection | Export Csv -Path C: Path.csv

Error below:

Exception when calling "ExecuteQuery" with "0" arguments: "The remote server returned an error: (401) Unauthorized."
In line: 34 characters: 1
+ $ context.ExecuteQuery ()
+ ~~~~~~~~~~~~~
+ CategoryInfo: NotSpecified: (:) (), MethodInvocationException
+ FullyQualifiedErrorId: WebException

An error occurred while listing a collection: The collection was not initialized. It was not requested or the request was not executed. This may need to be requested explicitly.
In line: 39 characters: 1
+ $ items | for each {
+~~~~~~~~~~~~
+ CategoryInfo: InvalidOperation: (Microsoft.Share … lient.ListItem): d__0) (), RuntimeException
+ FullyQualifiedErrorId: BadEnumeration

array – The fastest way to get a value from a CSV file using Java 7

My code selects a value from a too large csv file (~ 300 MB) for a given index i and j (assuming the csv as a 2D array contains only data without a header) works fine but is slow.
Is there another way to select a value faster from a CSV file?

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.FileInputStream;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.ArrayList;

public class Main
{

    public static String r1(String input,int i, int j,int bufferSize){

    String()() result = {};
    String row ="";

    try {
        BufferedReader r1 = new BufferedReader(new InputStreamReader(new FileInputStream(new File(input)), "UTF-8"), bufferSize);

        List lines = new ArrayList();

        while((row=r1.readLine())!=null){
            lines.add(row.split(","));
        }

        String()() csv = new String(lines.size())(0);
        lines.toArray(csv);
        result = csv;
        r1.close();
    }

    catch(IOException e){
        e.printStackTrace();
    }
        return result(i)(j);
}

public static void main(String() args){
    int bufferSize = 10 * 1024;   //10 KB.
    String filename = "matrix.csv"; 
    int i = 744, j = 7000;
    String pickedValue = r1(filename,i,j,bufferSize);
    System.out.println(pickedValue);
}

}

csv – How do I import separate data with a tab in R without leaving the NA elements?

I need an altruistic and selfless soul to help me with a problem when I try to import data from a CSV file into R, and try it with read.table (file.choose (), sep = " t" ) and with read_csv () but my problem is that the elements of my tibbles all NA come out, someone has an idea what happens, attached image in the format in which the data is (with tab separated) …
As you can see, the elements in the CSV file seem to be separated by tabs,

I am having trouble extracting the data from CSV files with Python (Pandas)

one of my csv files

As you can see in the first image, the first data group is ** HOLE and the second data group is ** GEOL in a single CSV file. And I have almost 500 CSV files that basically have the same format.

I can successfully extract the group data (** HOLE) because the header line in all CSV files is set as follows:

import pandas as pd
from os import chdir
import glob

#define and direct to the file path 
csv_file_path = 'C:/Users/Taurus Yong/Desktop/AGS3.1_new'
chdir (csv_file_path)

#create the file list in the path
csv_files = glob.glob('*.csv')

#create an empty list used later
list_data = ()

#loop to read csv files
for filename in csv_files:
    holeid = pd.read_csv(filename,header=5,skiprows=(7),usecols=(0,10,11,21,22))
    #get the holeid group only
    holeid = holeid(:holeid('*HOLE_FDEP').isnull().argmax())
    #filter all Trial Pits
    holeid = holeid(~holeid('*HOLE_ID').str.contains('TP'))
    #filter all the borehole depth less than 3m 
    holeid('*HOLE_FDEP') = pd.to_numeric(holeid('*HOLE_FDEP'))
    holeid.drop(holeid(holeid('*HOLE_FDEP')<=3).index,inplace=True)
    #combine new and old datas
    list_data.append(holeid)

#merge all the data
datas = pd.concat(list_data,ignore_index=False) 

#import all data to a new csv file
export_csv = datas.to_csv(r'C:UsersTaurus YongDesktopholeid.csv')

Next,
I would like to extract the group data (** GEOL) from all CSV files.

However, the code does not work if I have different records. As you can see in the picture, there are 3 records in this CSV file in the group (** HOLE) (22226DH1, 22226TP1, 22226TP2), but possibly 5 records in the group (** HOLE). Files, each CSV file has a different number of records, which means that the row as the header is not set for all CSV files.

I tried to run the code in a single CSV file:

#find the location of "**GEOL"
idx = data(data('*HOLE_ID') == '**GEOL').index
idx = idx + 1
data = pd.read_csv(io,header=idx)
print (data)

But does not work since header =? must be an integer.

Is there a way to extract the ** GEOL data for all 500 CSV files and save the data frame in a new CSV file?

Thanks for your help!

Convert the contacts.spb file from Samsung Smart Switch to VCF or CSV

I have created a backup of my Samsung Galaxy S4 with Samsung Smart Switch. Good, because my phone just hung up and died. I have ordered an iPhone X, but now I have to contact some of my contacts.

Smart Switch only seems to work if a working phone is connected to the USB port and Samsung Kies can not read the SPD format of Smart Switch.

Is there a way to convert the Smart Switch's SPD file to VCF or CSV so that I can view my contacts?

Javascript – Upload a CSV or TXT file into the FIREBASE memory using AndroidStudio

Well, let me tell you, I'm super-lost looking for a way to upload a .csv file (which can be TXT too) to Firebase storage. I really see the following:

Uri file = Uri.fromFile(new File("path/to/images/rivers.jpg"));
StorageReference riversRef = storageRef.child("images/rivers.jpg");

riversRef.putFile(file)
    .addOnSuccessListener(new OnSuccessListener() {
        @Override
        public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
            // Get a URL to the uploaded content
            Uri downloadUrl = taskSnapshot.getDownloadUrl();
        }
    })
    .addOnFailureListener(new OnFailureListener() {
        @Override
        public void onFailure(@NonNull Exception exception) {
            // Handle unsuccessful uploads
            // ...
        }
    });

and I do not understand where to put everything in the code, because if I put it that way (it's the one that comes out by default in androidstudio), two errors occur …

The first one is with storageRef: "Symbol'storageRef' can not be resolved"
The second is with getDownloadUrl: "method'storageRef' can not be resolved"

The problem is that I can not really upload a file in any way:

File f = new File("/data/data/com.example.me/files",String.valueOf(n)+".csv")

PD: Add the following as stated in the documentation:
private StorageReference mStorageRef;
mStorageRef = FirebaseStorage.getInstance (). getReference ();

private StorageReference mStorageRef;
mStorageRef = FirebaseStorage.getInstance().getReference();